/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jeff.springmvcstudy.controller;

import com.jeff.springmvcstudy.util.LogUtil;
import com.jeff.springmvcstudy.util.ViewManager;
import java.util.logging.Logger;
import org.springframework.stereotype.Component;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;

/**
 *
 * @author jeff
 */
@Component
public class InterfacedControllerImpl implements InterfacedController {
    private static final Logger LOG = LogUtil.getLogger(InterfacedControllerImpl.class);
    
    //as an interface-based controller bean, in the parameter list the @RequestParam
    //annotation can be omitted whereas @PathVariable cannot
    @Override
    public String doSth(@PathVariable String arg1, String arg2, Model model) {
        LOG.info("arg1=" + arg1 + "; arg2=" + arg2);
        model.addAttribute("arg1", arg1);
        model.addAttribute("arg2", arg2);
        
        return ViewManager.VIEW_DOSTH;
    }
    
}
